<template>
  <div class="consumptions-container">
    <el-card>
      <template #header>
        <h3>消费记录</h3>
      </template>
      
      <el-table :data="consumptions" border>
        <el-table-column prop="id" label="订单号" width="180" />
        <el-table-column prop="username" label="用户名" />
        <el-table-column prop="material.title" label="资料名称" />
        <el-table-column prop="amount" label="消费金额" width="120">
          <template #default="{row}">
            -¥{{ row.amount }}
          </template>
        </el-table-column>
        <el-table-column prop="createdAt" label="消费时间" width="180" />
      </el-table>
      
      <div class="pagination">
        <el-pagination
          layout="prev, pager, next"
          :total="total"
          :page-size="pageSize"
          @current-change="handlePageChange"
        />
      </div>
    </el-card>
  </div>
</template>

<script setup>
const consumptions = ref([])
const total = ref(0)
const pageSize = ref(20)

const handlePageChange = (page) => {
  // 分页逻辑
}
</script>

<style scoped>
.consumptions-container {
  padding: 20px;
}

.pagination {
  margin-top: 20px;
  text-align: right;
}
</style>